spinner: Define desired size at top of file
authorBenjamin Otte <otte@redhat.com>
Mon, 13 Sep 2010 23:09:53 +0000 (01:09 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 13 Sep 2010 23:09:53 +0000 (01:09 +0200)
No magic numbers in the code please

gtk/gtkspinner.c

index 2b3a53b3b3cbbf191ae0a37ed993130318267079..7f4233fd183a684589cd84767d0f7c82b2f8f980 100644 (file)
@@ -55,6 +55,8 @@
 
 G_DEFINE_TYPE (GtkSpinner, gtk_spinner, GTK_TYPE_DRAWING_AREA);
 
+#define SPINNER_SIZE 12
+
 enum {
   PROP_0,
   PROP_ACTIVE
@@ -228,8 +230,8 @@ gtk_spinner_expose (GtkWidget      *widget,
   width = allocation.width;
   height = allocation.height;
 
-  if ((width < 12) || (height <12))
-    gtk_widget_set_size_request (widget, 12, 12);
+  if ((width < SPINNER_SIZE) || (height < SPINNER_SIZE))
+    gtk_widget_set_size_request (widget, SPINNER_SIZE, SPINNER_SIZE);
 
   state_type = GTK_STATE_NORMAL;
   if (!gtk_widget_is_sensitive (widget))